<?php
class classMain{	
	//show template
	public function getTemplate($sTemplate){
        //preprare data for html head
        $eshopTitle ='';
        $eshopMeta ='';
        if(file_exists('data/configfiles/title.inc')) $eshopTitle = file_get_contents('data/configfiles/title.inc');
        if(file_exists('data/configfiles/meta.inc')) $eshopMeta = file_get_contents('data/configfiles/meta.inc');
        if(file_exists('data/configfiles/fastsearch.inc')) $eshopFSearch = file_get_contents('data/configfiles/fastsearch.inc');
        $_pService  = new classProductService();
        $_pSearch   = new classProductSearch();
        $_aService  = new classArticleService();
        $baseTag    = '<base href="http://'.$_SERVER['HTTP_HOST']._SYSTEM_SUBDIRS_.'" >';
        $titleTag   =   '<title>'.
                        $eshopTitle.
                        $_pService->getCategoryAndProductName().
                        $_aService->getCategoryAndArticleName().
                        '</title>';
        $metaDescr  = '<meta name="description" content="'.$eshopMeta.'" >';
        $metaKeyW   = '';
        $defaultJS  = '
            <script type="text/javascript" src="plugins/menu/montre.js"></script>
            <script type="text/javascript" src="plugins/menu/montreTopMenu.js"></script>
            <script type="text/javascript" src="plugins/follow/follow.js"></script>
            <script type="text/javascript" src="plugins/window/window.js"></script>
        ';
        if($eshopFSearch=='YES') $fastSearch = $_pSearch->getFastSearchForm();
        else $fastSearch = '';

        //prepare data for html body
        $_TopMenu = new classTopMenu();
        $_Menu = new classMenu();
        $_Products = new classProduct();
        $_Articles = new classArticle();
        

        //prepare data for html footer
        $defaultFooter =
            '<center>'.
            '<a href="http://code.google.com/p/openwinshop/" target="_blank">Open Win Shop</a> ('.
           '<a href="vinfo.html" target="_blank">'._ESHOP_VERSION_NO_.'</a>'.
            '), copyright &copy; <a href="licence.html" target="_blank">Michal Plesnivý</a> 2008-'.
            date('Y').
            '</center>';


		include ($sTemplate.'/index.inc.php');
	}
}
?>